﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Leo.Blog.ViewModel
{
    /// <summary>
    /// 生成树的节点
    /// </summary>
    public class TreeNode
    {
        public TreeNode()
        {
            Children = new List<TreeNode>();
        }
        [JsonProperty("id")]
        public int Id { get; set; }
        [JsonProperty("text")]
        public string Text { get; set; }
        //[JsonProperty("iconCls")]
        //public string IconName { get; set; }
        /// <summary>
        /// open/closed
        /// </summary>
        [JsonProperty("state", NullValueHandling = NullValueHandling.Ignore)]
        public string State { get; set; }
        [JsonProperty("checked", NullValueHandling = NullValueHandling.Ignore)]
        public bool? IsChecked { get; set; }
        /// <summary>
        /// Attributes对应的为json字符串
        /// </summary>
        [JsonProperty("attributes", NullValueHandling = NullValueHandling.Ignore)]
        public dynamic Attributes { get; set; }
        [JsonProperty("children", NullValueHandling = NullValueHandling.Ignore)]
        public List<TreeNode> Children { get; set; }
    }
}
